package phenix.com.phenixdemo.dummy;

import java.text.DateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 * <p/>
 * TODO: Replace all uses of this class before publishing your app.
 */
public class DummyContent {


    /**
     * A map of sample (dummy) items, by ID.
     */
    public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();


    public  DummyItem createDummyItem(String title) {
        Random random = new Random();
        return new DummyItem(null, title, makeDetails(random.nextInt()),
                DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).toString());
    }

    public static String makeDetails(int position) {
        StringBuilder builder = new StringBuilder();
        builder.append("Details about Item: ").append(position);
        for (int i = 0; i < position; i++) {
            builder.append("\nMore details information here.");
        }
        return builder.toString();
    }

    /**
     * A dummy item representing a piece of content.
     */
    public static class DummyItem {
        public  String id;
        public  String title;
        public  String comment;
        public  String date;


        public DummyItem(String id, String title, String comment, String date) {
            this.id = id;
            this.title = title;
            this.comment = comment;
            this.date = date;
        }

        @Override
        public String toString() {
            return title;
        }
    }
}
